package sk.fhi.client.event;

import java.util.HashSet;

import sk.fhi.shared.model.AbstractEntity;

import com.google.gwt.event.shared.GwtEvent;

public class DeleteEvent extends GwtEvent<DeleteEventHandler> {
	public static Type<DeleteEventHandler> TYPE = new Type<DeleteEventHandler>();
	
	final AbstractEntity entity;
	final HashSet<Long> deleteIds;
	
	public DeleteEvent(AbstractEntity entity, HashSet<Long> deleteIds) {
		super();
		this.entity = entity;
		this.deleteIds = deleteIds;
	}

	@Override
	protected void dispatch(DeleteEventHandler arg0) {
		arg0.onDeleteEvent(this);
	}

	@Override
	public Type<DeleteEventHandler> getAssociatedType() {
		return TYPE;
	}
	
	public HashSet<Long> getDeleteIds() {
		return deleteIds;
	}
	
	public AbstractEntity getEntity() {
		return entity;
	}

}
